import java.util.Scanner;

public class FacSum {
    public static int fac(int n){

        if(n==1){
            return 1;
        }
        return n*fac(n-1);
    }
    public static int facSum(int n){
        if(n==1){
            return 1;
        }else{
            return fac(n)+facSum(n-1);
        }

    }



    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        System.out.println("输入正整数n");
        int n= scan.nextInt();
        int sum=0;
        System.out.println(facSum(n));
    }
}
